<?php
namespace app\admin\controller;

class Activetable extends Come{
    public function table(){
        // $reslist=db('banner')->select();
        // $this->assign('reslist',$reslist);
        // return $this->fetch('banner-table');

        $res	=	db('admin_active')->paginate(1);
        //	把分页数据赋值给模板变量list
        $this->assign('res',$res);
        //	渲染模板输出
        return	$this->fetch('active-table');
    }
    public function delete(){
        $delId=input('param.delId','','htmlspecialchars');
        $res=db('banner')->where('id',$delId)->delete();
        if($res>0){
            $this->success('删除成功!','admin/activetable/table');
        }else{
            $this->error('删除失败');
        }
    }
}